#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# @Time: 2019/7/22  13:57
# @Author: 余浪人
# @email: yulangren520@gmail.com
from flask_login import UserMixin
from apps.models import db, BaseModel


class TL_Member_Model(BaseModel, UserMixin):
    username = db.Column(db.String(64))
    password = db.Column(db.String(256))
    user_skey = db.Column(db.String(20), default='')
    user_rk = db.Column(db.String(32), default='', unique=True)
    remark = db.Column(db.String(512))

    def __repr__(self):
        return f'当前管理员<{self.username}>'

    def keys(self):
        return 'username', 'remark', 'status', 'create_time', 'user_rk', 'user_rk'
